<?php $this->_extends('../_layouts/bootstrap_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/multi-select-metro.css" rel="stylesheet" />
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/chosen.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/chosen.jquery.min.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jquery.multi-select.js"></script>   
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/select2.min.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jquery.input-ip-address-control-1.0.min.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jquery.inputmask.bundle.min.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/date.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/app.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/form-components.js"></script>
<script type="text/javascript">
jQuery(document).ready(function()
{
	   App.init();
	   FormComponents.init();
});
</script>
<div class="span7">
<form method="post" action="<?=url('Setting::Basic/ShopAllotUserSave')?>">
<fieldset>
    <legend>店铺绑定用户</legend>
    <div class="control-group">
	<div class="controls">
		<input type="hidden" name="shop_id" value="<?=$shop_id ? $shop_id : ''?>" />
		<select id="my_multi_select2" name="user_ids[]" multiple="multiple" >
		<?foreach ($users as $u):?>
			<option value="<?=$u['id'];?>" <?if (in_array($u['id'], $shop_user_mapping)) echo "selected='selected'"?>><?=$u['name']?></option>
		<?endforeach;?>
		</select>
	</div>
	</div>
	<button type="submit" class="btn">确认分配</button>
</fieldset>
</form>
</div>
<?php $this->_endblock();?>